package com.zhou.util;

import org.apache.flink.api.common.typeinfo.BasicTypeInfo;
import org.apache.flink.api.java.typeutils.RowTypeInfo;

import java.sql.Types;

public class JDBCScript {
    public static final String DASHBOARD_JOB_QUERY=
            "SELECT\n" +
            "	hcq.court_uuid,\n" +
            "	hcq.region_company,\n" +
            "	hcq.project_city,\n" +
            "	hcq.project_name,\n" +
            "	hcq.erp_precinct_short_name,\n" +
            "	hcq.user_count total_house_number\n" +
            "FROM\n" +
            "	hdsc_cboard_query hcq\n" +
            "LEFT JOIN exclude_project ep ON hcq.erp_precinct_short_name = ep.project_name\n" +
            "WHERE\n" +
            "	ep.project_name IS NULL\n" +
            "AND court_uuid IS NOT NULL"
            ;
    public static final RowTypeInfo ROW_TYPE_INFO = new RowTypeInfo(
            BasicTypeInfo.STRING_TYPE_INFO,
            BasicTypeInfo.STRING_TYPE_INFO,
            BasicTypeInfo.STRING_TYPE_INFO,
            BasicTypeInfo.STRING_TYPE_INFO,
            BasicTypeInfo.STRING_TYPE_INFO,
            BasicTypeInfo.INT_TYPE_INFO);

     public static final String RESULT_CHART_INSERT=
             "INSERT INTO `buried`.`chat_detail` (\n" +
                     "	`region`,\n" +
                     "	`community_id`,\n" +
                     "	`community_name`,\n" +
                     "	`stat_time`,\n" +
                     "	`send_time`,\n" +
                     "	`message`,\n" +
                     "	`user_id`,\n" +
                     "	`user_name`,\n" +
                     "	`user_type`,\n" +
                     "	`session_id`\n" +
                     ")\n" +
                     "VALUES\n" +
                     "	(?, ?, ?, ?, ?, ?, ?, ?, ?, ?);";

    public static final int[] SQL_TYPES=new int[]{Types.VARCHAR, Types.VARCHAR, Types.VARCHAR,Types.VARCHAR,
            Types.TIMESTAMP,Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.INTEGER,Types.VARCHAR };

}
